<template>
  <div id="areaStack" ref="areaStack" style="height: 40vh" />
</template>
<script>
export default {
  name: "AreaStack",
  data() {
    return {};
  },
  mounted() {
    const areaStack = this.$echarts.init(this.$refs.areaStack, "light");
    const options = {
      title: {
        text: "",
      },
      legend: {
        data: ["活跃员工", "摸鱼员工"],
      },
      grid: {
        left: "3%",
        right: "4%",
        bottom: "3%",
        containLabel: true,
      },
      xAxis: [
        {
          type: "category",
          boundaryGap: false,
          data: ["周一", "周二", "周三", "周四", "周五"],
        },
      ],
      yAxis: [
        {
          type: "value",
        },
      ],
      series: [
        {
          name: "摸鱼员工",
          type: "line",
          stack: "总量",
          areaStyle: {},
          data: [40, 90, 101, 50, 80],
        },
        {
          name: "活跃员工",
          type: "line",
          stack: "总量",
          areaStyle: {},
          data: [220, 270, 310, 234, 350],
        },
      ],
    };

    areaStack.setOption(options);
  },
};
</script>